<%--
  Created by IntelliJ IDEA.
  User: fyf
  Date: 2018/11/12
  Time: 9:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>班级信息修改页面</title>
  <link rel="stylesheet" href="https://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  <jsp:include page="/common/basecss.jsp" flush="true"/>
  <script src="${pageContext.request.contextPath}/bootstrap-3.3.7/js/bootstrap.min.js"></script>
</head>
<body>


<form role="form" method="post">

  <h5 class="page-header alert-info" style="padding:10px; margin:0px; margin-bottom:5px;">班级信息</h5>
  <div class="row">
    <div class="col-sm-5">
      <div class="form-group">
        <label class="col-sm-3 control-label">班级id</label>
        <div class="col-sm-9">
          <input type="text" name="id" id="id" readonly="readonly" value="${tclass.id}"
                 class="form-control input-sm" placeholder="后台生成角色编号"/>
        </div>
      </div>

    </div>
    <div class="col-sm-5">
      <div class="form-group">
        <label class="col-sm-3 control-label">班级名称</label>
        <div class="col-sm-9">
          <input type="text" name="classname"  id="classname" class="form-control input-sm" value="${tclass.classname}"/>
        </div>
      </div>
    </div>

  </div>

  <%--分公司id--%>
  <input type="hidden" name="branchid" id="branchid"   value="${branchid}">

  <div class="row">
    <div class="col-sm-3 col-sm-offset-4">
      <input  type="button" class="btn btn-white btn-inverse" id="submitButton" value="保存"/>

    </div>
  </div>
</form>

<script>
  $(function () {
      $('#submitButton').click(function () {

          var params = "id=" + $('#id').val() + '&classname=' + $('#classname').val()+"&branchid=" + $('#branchid').val();
          $.ajax({
              type:'post',
              url:'updateTClass.go',
              data:params,
              dataType: 'json',
              success:function (resData) {
                  if (resData!=null){
                      layer.msg('更新成功！',{icon: 1});
                      //更新成功则刷新父级页面
                      setTimeout(function () {
                          parent.location.reload();
                      },1000)
                  } else {
                      layer.msg('更新失败！',{icon: 2});
                  }
              },
              error:function () {
                  layer.msg('更新失败！',{icon: 2});
              }
          });


      })



  });
</script>



<jsp:include page="/common/basejs.jsp" flush="true"/>
</body>
</html>
